package com.test.redis.dto;

import com.test.redis.entity.MeetingRoom;
import com.test.redis.entity.ReservationRecord;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;

/**
 * 转换器
 */
@Mapper(componentModel = "spring")
public interface ReservationConverter {
    
    ReservationRecord toEntity(ReservationRequest request);
    
    ReservationRecordDTO toDTO(ReservationRecord record);
    
    @Mapping(target = "roomName", ignore = true)
    ReservationRecordDTO toDTO(ReservationRecord record, MeetingRoom room);
}